import threading, multiprocessing
x = 0
def loop():
    global x
    while True:
        x = x ^ 1
        print(x)

for i in range(multiprocessing.cpu_count()):
    t = threading.Thread(target=loop)
    t.start()